cmake_minimum_required(VERSION 3.0.0)
project(testlibuv VERSION 0.1.0)

add_compile_options(-std=c99 -D_GNU_SOURCE)


if(WIN32)
    set(PLATFORM_SRC
        win/udp.c
    )
else()
    set(PLATFORM_SRC
        unix/udp.c
        unix/tcp.c
    )
endif(WIN32)



add_library(libfuv
    netforward.c
	cmap.c
	uv_common.c
    uv_thread.c
    debug.c
    thrqueue_cs.c
    ${PLATFORM_SRC}
)

if(WIN32)
    target_link_libraries(libfuv  ws2_32)
else()
    target_link_libraries(libfuv  -pthread m)
endif(WIN32)

################################



add_executable(testbin
main.c
)

target_link_libraries(testbin libfuv)


################################

add_executable(tsttcp

tsttcp.c

)

target_link_libraries(tsttcp libfuv)
################################